<%@ Page Language="c#" CodeBehind="FormAccess.aspx.cs" AutoEventWireup="True" Inherits="FormsGenerator.FormAccess" %>

<%@ Register TagPrefix="uc1" TagName="ShowHelp" Src="~/Controls/ShowHelp.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>FormAccess</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="Styles/Default.css" type="text/css" rel="stylesheet" />

    <script language="javascript" type="text/javascript">
		function CheckboxAll_clicked(theCheckBox)
		{
			if (theCheckBox.checked)
			{
				FormAccess.TextBoxUsername.disabled = true;
			}
			else
			{
				FormAccess.TextBoxUsername.disabled = false;
			}			
		}
		
		function ConfirmDeletion()
		{
		
		}
    </script>

</head>
<body>
    <form id="FormAccess" method="post" runat="server">
    <p>
        <asp:Label ID="LabelErrorMessage" runat="server" Visible="False" EnableViewState="False"
            CssClass="ErrorMessage"></asp:Label></p>
    <asp:Panel ID="PanelFormAccess" runat="server" Visible="False">
        <p>
            Add user:&nbsp;<br />
            <asp:TextBox ID="TextBoxUsername" runat="server" OnTextChanged="TextBoxUsername_TextChanged"></asp:TextBox>
            <asp:Button ID="ButtonUpdate" runat="server" Text="Update" OnClick="ButtonUpdate_Click">
            </asp:Button><br />
            <asp:CheckBox ID="CheckBoxAll" onclick="CheckboxAll_clicked(this);" runat="server"
                Text="Share to all" OnCheckedChanged="CheckBoxAll_CheckedChanged"></asp:CheckBox></p>
        <p>
            <asp:Label ID="LabelConfirmMessage" runat="server" EnableViewState="False"></asp:Label>The
            form is currently shared to:</p>
        <asp:DataGrid ID="DataGridFormAccess" runat="server" Visible="False" AllowSorting="True"
            AutoGenerateColumns="False" BorderColor="#000099" BorderStyle="None" BorderWidth="1px"
            BackColor="White" CellPadding="3" GridLines="Horizontal">
            <SelectedItemStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#738A9C"></SelectedItemStyle>
            <AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>
            <ItemStyle ForeColor="#4A3C8C" BackColor="#E6EAFF"></ItemStyle>
            <HeaderStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#000099"></HeaderStyle>
            <FooterStyle ForeColor="#4A3C8C" BackColor="#CCCCCC"></FooterStyle>
            <Columns>
                <asp:BoundColumn Visible="False" DataField="FormsAccessId" ReadOnly="True"></asp:BoundColumn>
                <asp:BoundColumn DataField="UserId" HeaderText="User Id"></asp:BoundColumn>
                <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel"
                    EditText="Edit"></asp:EditCommandColumn>
                <asp:ButtonColumn Text="Remove" CommandName="Delete"></asp:ButtonColumn>
            </Columns>
        </asp:DataGrid>
        <asp:Label ID="LabelSharedToAll" runat="server" Font-Bold="True">
					<ul>
						<li>
							The Form is shared to all users</li></ul>
        </asp:Label>
        <asp:Label ID="LabelSharedToNone" runat="server" Font-Bold="True">
					<ul>
						<li>
							The form is not shared. Please add users or share the form to all users</li></ul>
        </asp:Label>
        <br />
        <asp:Panel ID="PanelInstructions" runat="server" CssClass="Instructions" Width="100%">
            <ul>
                <li>The forms are personalized, meaning that the forms you create are visible only to
                    you. You can share your forms to other users, by adding their usernames.&nbsp;A
                    shared form can be viewed and edited by the users that has access to them. A locked
                    form can only be edited by the user who has locked the form.&nbsp;&nbsp;
                    <li>To&nbsp;<b>add </b>a user,&nbsp;fill in username and click the "Update" button (remember
                        domain if users are on a domain, i.e DOMAIN\Username)&nbsp;
                        <li>To <b>edit</b> a user, click the "Edit" link in the list of users.&nbsp;
                            <li>To&nbsp;<b>remove</b> a user, click the "Remove" link in the list of user.
                                <li>To <strong>share the form to all users</strong>, check the "Share to all" checkbox
                                    and click the "Update" button.</li></ul>
        </asp:Panel>
    </asp:Panel>
    </form>
</body>
</html>
